import axios from "axios";

const BaseUrl = 'http://127.0.0.1:8083'

const __axios = axios.create({
    baseURL: BaseUrl,
    timeout: 4000
})

const api = {
    getIndexData: () => {
        return http.get({}, "/index/indexData")
    }
}

const http = {

    get: (params, url) => {
        return new Promise((resolve, reject) => {
            __axios.get(url, {
                params: params,
                responseEncoding: 'UTF-8',
                responseType: 'json'
            }).then(res => {
                resolve(res.data)
            }).catch(err => {
                reject(err)
            })
        })

    }
}


export default api
